#!/bin/sh
set -e

if [ -n "$PDNSDEBUG" ]; then
  echo "now debugging $0 $@"
  set -x
fi

PKGNAME="pdns-backend-pgsql"

# Remove files previously registered with ucf (but keep the files).
# 4.1.3-4 and newer no longer install a (ucf) conffile.
# We stopped depending on ucf, so avoid calling ucf when it is not present.
if command -v ucfq >/dev/null; then
  for file in $(ucfq --with-colons "$PKGNAME" | cut --delimiter=: --fields=1); do
    ucf --purge ${file}
    ucfr --purge $PKGNAME ${file}
  done
fi

dpkg-trigger pdns-server

#DEBHELPER#

exit 0
